Skip to content

fix(lights): synchronize headlight material and shadow with vehicle alarm flashing - #334

Merged
user-grinch merged 1 commit into
user-grinch:mainfrom
CanerKaraca23:fix/alarm-headlight-flashing
Sep 18, 2026
Merged

user-grinch merged 1 commit into
user-grinch:mainfrom
CanerKaraca23:fix/alarm-headlight-flashing

Conversation

@CanerKaraca23

Copy link
Copy Markdown
Collaborator

Summary

When a parked vehicle's alarm is triggered (m_nAlarmState != 0 && m_nAlarmState != 0xFFFF), GTA SA alternates the headlights and horn in 256ms cycles ((m_nAlarmState & 0x100) != 0).

Previously in ModelExtras:

  1. LightManager::Render returned early when the vehicle engine was off during the daytime, completely suppressing the light render loop and resetting m_renderLights.
  2. HeadlightComponent::Process and HeadlightComponent::Render did not track m_nAlarmState. As a result, headlight materials and front ground shadows stayed permanently off during daytime alarm sounds and stayed permanently on at night without flashing.

Changes

  • In LightManager::Render, allow the render loop to proceed when isAlarmActive is true even if the engine is off.
  • In HeadlightComponent::Process and Render, check (m_nAlarmState & 0x100) != 0 to synchronize headlight materials and shadows with the alarm ON/OFF pulse intervals in both daytime and nighttime.
  • Preserved existing SA-MP and manual light override behaviors.

@user-grinch
user-grinch merged commit 34965b9 into user-grinch:main Sep 18, 2026
@CanerKaraca23
CanerKaraca23 deleted the fix/alarm-headlight-flashing branch September 18, 2026 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants